<?php /* Smarty version Smarty-3.0-RC2, created on 2013-11-17 07:07:23
         compiled from "D:/www/htdocs/web/application/views/admin/pages/section_table.tpl" */ ?>
<?php /*%%SmartyHeaderCode:1257852885d1b0e4406-23798779%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '07ee0cb1d6e705c0b0916d6d0ea512a1270e5169' => 
    array (
      0 => 'D:/www/htdocs/web/application/views/admin/pages/section_table.tpl',
      1 => 1293412016,
    ),
  ),
  'nocache_hash' => '1257852885d1b0e4406-23798779',
  'function' => 
  array (
  ),
  'has_nocache_code' => false,
)); /*/%%SmartyHeaderCode%%*/?>

<table id=table class="adminlist">
	<thead>
		<tr>
			<th style='text-align:center;'>#</th>

			<th id='title'  class='<?php echo $_smarty_tpl->getVariable('data')->value['title'];?>
' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Section</a></th>

			
			<th id='state' class='<?php echo $_smarty_tpl->getVariable('data')->value['sort_state'];?>
' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Diterbitkan </a></th>
		  
			<th id='created' class='<?php echo $_smarty_tpl->getVariable('data')->value['sort_created'];?>
' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">Tanggal</a></th>
		  
			<th id='contentID' class='<?php echo $_smarty_tpl->getVariable('data')->value['sort_contentID'];?>
' style='cursor:pointer; text-align:center;'>
			<a href="javascript:void();">ID</a></th>
		</tr>
	</thead>
	
	<tbody>

	<?php if ($_smarty_tpl->getVariable('data')->value['rows']){?>
		<?php  $_smarty_tpl->tpl_vars['i'] = new Smarty_Variable;
 $_from = $_smarty_tpl->getVariable('data')->value['rows']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
 $_smarty_tpl->tpl_vars['smarty']->value['foreach']['data']['iteration']=0;
if (count($_from) > 0){
    foreach ($_from as $_smarty_tpl->tpl_vars['i']->key => $_smarty_tpl->tpl_vars['i']->value){
 $_smarty_tpl->tpl_vars['smarty']->value['foreach']['data']['iteration']++;
?>	
			<?php $_smarty_tpl->assign('css',$_smarty_tpl->getVariable('smarty')->value['foreach']['data']['iteration']%2==0 ? "'row0'" : "'row1'",null,null);?>
			
			<tr class=<?php echo $_smarty_tpl->getVariable('css')->value;?>
>
				<td class='tc'><span class="tag tag-gray"><?php echo $_smarty_tpl->getVariable('smarty')->value['foreach']['data']['iteration']+$_smarty_tpl->getVariable('data')->value['offset'];?>
</span></td>
				<td class='edit'>
					<a href='<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
admin/sectionForm/<?php echo $_smarty_tpl->tpl_vars['i']->value['sectionID'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['order'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['sort'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['paging']['c'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['limit'];?>
'>
					<?php echo $_smarty_tpl->tpl_vars['i']->value['title'];?>

					</a>
				</td>
				
				<?php if ($_smarty_tpl->tpl_vars['i']->value['state']=='1'){?>
				<td  class='publish center'>
					<a id='<?php echo $_smarty_tpl->tpl_vars['i']->value['contentID'];?>
' class='<?php echo $_smarty_tpl->tpl_vars['i']->value['state'];?>
' >
					<img id='img_<?php echo $_smarty_tpl->tpl_vars['i']->value['contentID'];?>
' src='<?php echo $_smarty_tpl->getVariable('site')->value['assets'];?>
css/img/led-ico/publish.png' border=0/>
					</a>				
				<?php }else{ ?>
				<td class='publish center'>
					<a id='<?php echo $_smarty_tpl->tpl_vars['i']->value['contentID'];?>
' class='<?php echo $_smarty_tpl->tpl_vars['i']->value['state'];?>
' >
					<img id='img_<?php echo $_smarty_tpl->tpl_vars['i']->value['contentID'];?>
' src='<?php echo $_smarty_tpl->getVariable('site')->value['assets'];?>
css/img/led-ico/unpublish.png' border=0/>
					</a>					
				<?php }?>
				</td>
				<td class='tc'><?php echo $_smarty_tpl->tpl_vars['i']->value['created'];?>
</td>
				<td class='tc'><?php echo $_smarty_tpl->tpl_vars['i']->value['contentID'];?>
</td>
			</tr>
		<?php }} ?>
	<?php }?>
	</tbody>
	
	<tfoot>
	<tr>
		<td colspan="13">
		<del class="container">
			<div class="pagination"><div class="paging">
			
				<?php if (count($_smarty_tpl->getVariable('data')->value['paging'])>0){?>
				<a class='first' href='<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
admin/section/<?php echo $_smarty_tpl->getVariable('data')->value['order'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['sort'];?>
/1/<?php echo $_smarty_tpl->getVariable('data')->value['limit'];?>
'></a>
				<a class='prev'  href='<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
admin/section/<?php echo $_smarty_tpl->getVariable('data')->value['order'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['sort'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['paging']['p'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['limit'];?>
'></a>     
				<span>Page <?php echo $_smarty_tpl->getVariable('data')->value['paging']['c'];?>
 of <?php echo $_smarty_tpl->getVariable('data')->value['paging']['l'];?>
 </span>
				<a class='next'  href='<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
admin/section/<?php echo $_smarty_tpl->getVariable('data')->value['order'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['sort'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['paging']['n'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['limit'];?>
'></a>
				<a class='last'  href='<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
admin/section/<?php echo $_smarty_tpl->getVariable('data')->value['order'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['sort'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['paging']['l'];?>
/<?php echo $_smarty_tpl->getVariable('data')->value['limit'];?>
'></a>
				<?php }?>
			</div></div>
		</del>
		</td>
	</tr>
	</tfoot>

</table>


<script id="category-script" type="text/javascript">
$(document).ready(function(){
	$("#table thead th").each(
	   function(){
		  $( this ).bind (
			 "click",
			 function(){
				var id   =  $(this).attr('id') ;
				var sort =  $(this).attr('class');
				
				$('#table').load('<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
adminajax/sectionSorting/' + id + '/' + sort + '/' + <?php echo $_smarty_tpl->getVariable('data')->value['page'];?>
 + '/' + <?php echo $_smarty_tpl->getVariable('data')->value['limit'];?>
);
			 }
		  );
	   }
	);   

	$('.publish a').click( function (e) {
		var id = $(this).attr('id');
		var publish = $(this).attr('class');

		var _post = [{ name:'id', value:id }]
		_post.push({ name:'publish', value:publish });
		
		$.post('<?php echo $_smarty_tpl->getVariable('site')->value['site'];?>
adminajax/sectionPublishing/', _post, function(response) {
			//alert(id + '=' + response + '=' + publish);
			
			if (response=="0"){
				$(this).attr('class', '1');
				$('#img_' + id).attr('src', '<?php echo $_smarty_tpl->getVariable('site')->value['assets'];?>
css/img/led-ico/unpublish.png');
			} else if (response=="1"){
				$(this).attr('class','0');
				$('#img_' + id).attr('src', '<?php echo $_smarty_tpl->getVariable('site')->value['assets'];?>
css/img/led-ico/publish.png');
			} else {
				alert(response);
			}
		});
	});
});
</script>